package com.WISSC.serviceImpl;

import com.WISSC.bean.Configure;
import com.WISSC.bean.Occupation;
import com.WISSC.bean.layuiBean.ResultPage;
import com.WISSC.bean.layuiBean.VoPage;
import com.WISSC.mapper.ConfigureMapper;
import com.WISSC.service.ConfigureService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 配置值
 服务实现类
 * </p>
 *
 * @author 冯政尚
 * @since 2019-06-06
 */
@Service
public class ConfigureServiceImpl extends ServiceImpl<ConfigureMapper, Configure> implements ConfigureService {

    @Override
    public ResultPage<Configure> selectConfigure(int current,int size) {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("page", (current - 1) *size);
        paramMap.put("limit", size);
        List<Configure> list = baseMapper.selectConfigure(paramMap);
        Integer count = baseMapper.countConfigure(paramMap);
        ResultPage<Configure> resultPage = new ResultPage<>();
        resultPage.setCode(0);
        resultPage.setCount(count);
        resultPage.setMsg("成功");
        resultPage.setData(list);
        return resultPage;
    }


}
